#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N=2e5+1;
ll n,a[N],dp[N],t;

int main()
{
	freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
	for(ll k=1;k<=t;++k)
	{
		scanf("%lld",&n);
		for(ll i=1;i<=n;++i)
			scanf("%lld",a+i);
		for(ll i=2;i<=n;++i)
			dp[i]=max(dp[i-1],dp[i-2]+a[i]);
		printf("%lld\n",dp[n]);	
	}
	return 0;
}
